//
//  CXLEmoticon.swift
//  Emotion
//
//  Created by 曹晓龙 on 15/10/23.
//  Copyright © 2015年 曹晓龙. All rights reserved.
//

import UIKit

/// 表情图片模型
class CXLEmoticon: NSObject {

    /// 图片字符
    var chs:String?
    
    /// png图片
    var png:String?
    
    /// 图片的完整路径
    var pngPath:String{
        
        if png == nil {
            
            return " "
        }
        
        return NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
    }
    
    /// emoji 16进制字符串图片
    var code:String?{
        
        didSet{
            emoji = code?.emoji
        }
    }
    
    /// 将code转成图片string
    var emoji:String?
    
    
    /// 删除按钮
    var isRemoveBtn = false
    
    /// 空白按钮
    var isEmptyBtn = false
    
    /// 点击次数
    var times = 0
    
    init(isEmptyBtn:Bool){
        
        self.isEmptyBtn = isEmptyBtn
    }
    
    init(isRemoveBtn:Bool){
        
        self.isRemoveBtn = isRemoveBtn
    }
    
    //MARK: -构造方法
    init(dict:[String: AnyObject]){
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    
    
    override var description:String {
        
        let keys = ["chs", "png", "code"]
        
        return dictionaryWithValuesForKeys(keys).description
    }
    
}
